﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Vds2465Telegrams
{
	[TestClass]
	public class UserData_01_Priority_Test
	{
		[TestMethod]
		[Owner("Frank Eppink")]
		public void Test01_Equals()
		{
			UserData_01_Priority userData01Priority = new UserData_01_Priority(0x89);

			{
				// completely different type - NOT equal
				object dummyObject = new object();
				Assert.IsFalse(userData01Priority.Equals(dummyObject));
			}

			{
				// different derived type 
				ReportType_Device reportType = new ReportType_Device(false, eReportSubType_Device.General);
				UserData userData = new UserData_02_StatusChangeReport2Confirm(0x01, 0x02, 0x03, eAddressExtension_1.Input, reportType);
				Assert.IsFalse(userData01Priority.Equals(userData));
			}

			{
				// same object - equal
				UserData_01_Priority userData01Priority2Compare = new UserData_01_Priority(userData01Priority.PriorityReduction);
				Assert.IsTrue(userData01Priority.Equals(userData01Priority2Compare));
			}

			{
				// different property values - NOT equal
				UserData_01_Priority userData01Priority2Compare = new UserData_01_Priority((byte) (userData01Priority.PriorityReduction + 1));
				Assert.IsFalse(userData01Priority.Equals(userData01Priority2Compare));
			}
		}

		[TestMethod]
		[Owner("Frank Eppink")]
		public void Test02_GetHashCode()
		{
			UserData_01_Priority userData01Priority = new UserData_01_Priority(0x89);
			int hashCode01 = userData01Priority.GetHashCode();
		}

		[TestMethod]
		[Owner("Frank Eppink")]
		public void Test03_ToString()
		{
			UserData_01_Priority userData01Priority = new UserData_01_Priority(0x34);
			string string01 = userData01Priority.ToString();
			Assert.IsNotNull(string01);
		}
	}
}
